//
//  XJLeftMenuController.m
//  ttpod
//
//  Created by dllo on 16/3/21.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "XJLeftMenuController.h"
#import "XJLeftMenuCell.h"

@interface XJLeftMenuController () <UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *leftTableView;

@property (nonatomic,retain) NSArray *arrayOfLabel;

@property (nonatomic, retain) NSArray *arrayOfImage;

@end

@implementation XJLeftMenuController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self handleData];
    
    self.leftTableView.backgroundColor = [UIColor clearColor];
   
    [self.leftTableView registerNib:[UINib nibWithNibName:@"XJLeftMenuCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"pool1"];
    
    self.leftTableView.delegate = self;
    
    self.leftTableView.dataSource = self;
    
    
}

- (void)handleData {
    
    self.arrayOfLabel = @[@"导入歌曲",@"听歌识曲",@"更换壁纸",@"睡眠设置",@"音效",@"付费包月",@"流量包",@"设置",@"仅wifi联网"];
    
    
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
    
    return 9;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    XJLeftMenuCell *cell = [tableView dequeueReusableCellWithIdentifier:@"pool1"];
    
    cell.backgroundColor = [UIColor clearColor];
 
    cell.rightLabel.text = self.arrayOfLabel[indexPath.row];
    
    NSString *image = [NSString stringWithFormat:@"%ld",indexPath.row+1];
    
    cell.imageView.image = [UIImage imageNamed:image];
    
    return cell;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    NSLog(@"%f",tableView.frame.size.height/self.arrayOfLabel.count);
    
   return  tableView.frame.size.height/self.arrayOfLabel.count;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
